package demo.java.mail;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Arnold Yand
 * @since Jun 15, 2017 9:14:45 PM
 * @summary demo.java.mail.MailContent.java
 */
public class MailContent {

  // 主题
  private String subject;
  // 发件人
  private String from;
  // 收件人(可能有多个)
  private List<String> to = new ArrayList<String>();
  // 抄送(可能有多个)
  private List<String> cc = new ArrayList<String>();
  // 秘送(可能有多个)
  private List<String> bcc = new ArrayList<String>();
  // 发送日期
  private String sentDate;
  // 是否已读
  private boolean seen;
  // 邮件优先级
  private String priority;
  // 是否需要回执
  private boolean replySign;
  // 邮件大小(byte)
  private int size;
  // 邮件正文
  private String content;

  public String getSubject() {
    return subject;
  }

  public void setSubject(String subject) {
    this.subject = subject;
  }

  public String getFrom() {
    return from;
  }

  public void setFrom(String from) {
    this.from = from;
  }

  public List<String> getTo() {
    return to;
  }

  public void setTo(List<String> to) {
    this.to = to;
  }

  public List<String> getCc() {
    return cc;
  }

  public void setCc(List<String> cc) {
    this.cc = cc;
  }

  public List<String> getBcc() {
    return bcc;
  }

  public void setBcc(List<String> bcc) {
    this.bcc = bcc;
  }

  public String getSentDate() {
    return sentDate;
  }

  public void setSentDate(String sentDate) {
    this.sentDate = sentDate;
  }

  public boolean isSeen() {
    return seen;
  }

  public void setSeen(boolean seen) {
    this.seen = seen;
  }

  public String getPriority() {
    return priority;
  }

  public void setPriority(String priority) {
    this.priority = priority;
  }

  public boolean getReplySign() {
    return replySign;
  }

  public void setReplySign(boolean replySign) {
    this.replySign = replySign;
  }

  public int getSize() {
    return size;
  }

  public void setSize(int size) {
    this.size = size;
  }

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  @Override
  public String toString() {
    StringBuffer email = new StringBuffer();
    email.append("[SUBJECT]:" + this.subject).append("\n");
    email.append("[FROM]:" + this.from).append("\n");
    email.append("[TO]:" + this.to).append("\n");
    email.append("[CC]:" + this.cc).append("\n");
    email.append("[BCC]:" + this.bcc).append("\n");
    email.append("[SENTDATE]:" + this.sentDate).append("\n");
    email.append("[SEEN]:" + this.seen).append("\n");
    email.append("[PRIORITY]:" + this.priority).append("\n");
    email.append("[NEEDREPLY]:" + this.replySign).append("\n");
    email.append("[SIZE]:" + this.size).append(" byte\n");
    email.append("[CONTENT]:\n" + this.content);
    return email.toString();
  }
}
